<!DOCTYPE HTML>
<html>
<head>
    <meta name="viewport" content="width=device-width,minimum-scale=1.0,maximum-scale=1.0,user-scalable=no">
    <title>分享得红包</title>
    <link rel="stylesheet" href="<?php echo $this->staticUrl;?>wx/css/weui.min.css">
    <link rel="stylesheet" href="<?php echo $this->staticUrl;?>wx/css/swiper.min.css">
    <link rel="stylesheet" href="<?php echo $this->staticUrl;?>wx/css/base.css">
    <link rel="stylesheet" href="<?php echo $this->staticUrl;?>wx/css/style.css">
    <script src="<?php echo $this->staticUrl?>wx/js/swiper.min.js"></script>
    <script src="<?php echo $this->staticUrl?>wx/js/jquery.min.js"></script>
</head>
<body style="background: #fff9e7;">
    <div class="pos wp100" style="top: 0;left: 0;">
        <div class="swiper-container" style="height: 30px">
            <div class="swiper-wrapper">
                <?php if($info['list']):?>
                    <?php foreach ($info['list'] as $v):?>
                        <div class="swiper-slide tc">
                            <?php echo $v['nickname'];?> &nbsp;&nbsp;成功邀请<?php echo $v['consumerCount']?>个好友
<!--                            ，得到--><?php //echo $v['bonusCount']?><!--个红包-->
                        </div>
                    <?php endforeach;?>
                <?php endif;?>
            </div>
        </div>
    </div>
    <img src="<?php echo $info['share_img']?>" class="wp100" alt="">
    <img src="<?php echo $info['share_step']?>" class="wp100" alt="">
    <a class="kbtn share1" href="javascript:;" style="width: 60%;background: #ff6501;">点击分享领红包</a>
    <div class="wp75 m0a heng mt10">
        <div class="wpthree">
            <p class="tc"><?php echo $info['amount']?></p>
            <p class="tc f08">获得佣金(元)</p>
        </div>
        <div class="wpthree">
            <p class="tc"><?php echo $info['bonusCount']?></p>
            <p class="tc f08">累计红包(个)</p>
        </div>
        <div class="wpthree">
            <p class="tc"><?php echo $info['consumerCount']?></p>
            <p class="tc f08">成功邀请(人)</p>
        </div>
    </div>
    <div style="height: 1px;background: #ff6501;opacity: 0.2;"></div>
    <div class="fonts p3p">
        <?php echo $info['content']?>
    </div>
    <a class="kbtn share2" href="javascript:;" style="width: 60%;background: #ff6501;">点击生成专属二维码分享</a>
</body>
<script>
    var mySwiper = new Swiper ('.swiper-container', {
        loop: true,
        direction: 'vertical',
        autoplay:3000,
    })

    var json = '<?php echo json_encode($share);?>';
   var  data = JSON.parse(json);
    var u = navigator.userAgent;
    var isAndroid = u.indexOf('Android') > -1 || u.indexOf('Adr') > -1; //android终端
    var isiOS = !!u.match(/\(i[^;]+;( U;)? CPU.+Mac OS X/); //ios终端
    //通信对象
    if( ! jsGebi){
        var jsGebi = {
            onShare:function(type, data){
                onShare(type, data)
            },
        }
//        document.title = 'jsGebi对象不存在，则说明你是ios';
    }else{
//        document.title = 'jsGebi对象存在，则说明你是android';
    }
    $(".share1").on('click',function(){
        if(isiOS){
            data.type = 1;
            console.log(JSON.stringify(data));
            window.webkit.messageHandlers.onShare.postMessage(JSON.stringify(data));
        }

        if(isAndroid){
            jsGebi.onShare(1, json);
        }
    })

    $(".share2").on('click',function(){
        if(isiOS){
            data.type = 2;
            window.webkit.messageHandlers.onShare.postMessage(JSON.stringify(data));
        }
        if(isAndroid){
            jsGebi.onShare(2, json);
        }

    })

</script>
<script src="<?php echo $this->staticUrl;?>wx/js/base.js"></script>

</html>